import java.io.*;
import java.util.*;

public class Main {
	BufferedReader bf;
	StringTokenizer st;
	StringBuilder sb;
	
	int start,
		end;
	List<Integer> perfects;
	
	public Main() {
		bf = new BufferedReader(new InputStreamReader(System.in));
		sb = new StringBuilder();
	}
	
	public static void main(String[] args) {
		Main main = new Main();
		main.beginProcess();
	}

	public void beginProcess() {
		try {
			int i;
			String input,
				   output;

			getPerfects();
			
			while((input = bf.readLine()) != null) {
				st = new StringTokenizer(input);
				start = Integer.parseInt(st.nextToken());
				end = Integer.parseInt(st.nextToken());
				
				output = "";
				for(i = 0; i < perfects.size(); i++) {
					if(start <= perfects.get(i) && end >= perfects.get(i))
						output += perfects.get(i) + " ";
				}
				
				if(output.equals(""))
					output = "null";
				else
					output = output.substring(0, output.length() - 1);
				
				sb.append(output + "\n");
			}

			System.out.print(sb);
		}
		catch(Exception ex) {
			System.err.println(ex.toString());
		}
	}
	
	private void getPerfects() {
		int i,
			j,
			sum,
			idx = 0;
		
		perfects = new ArrayList<Integer>();
		for(i = 2; i < 10000; i++) {
			sum = 0;
			for(j = 1; j <= i / 2; j++) {
				if(i % j == 0)
					sum += j;
			}
			if(sum == i) {
				perfects.add(idx, i);
				idx++;
			}
		}
	}
	
}